import warnings
import pytest

# pytestmark = pytest.mark.filterwarnings("ignore:自定义")
pytestmark = pytest.mark.filterwarnings("ignore")


class Test01:
    def test_a(self):
        print("---test_a")
        assert self.fun() == 1

    def fun(self):
        print("---fun")
        warnings.warn(UserWarning("自定义warning"))
        return 1